package com.project.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.project.bean.ShopCartBean;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.ResultMap;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface IShopCartMapper extends BaseMapper<ShopCartBean> {
    @ResultMap("shopCartMap")
    @Select("select * from t_shopCart left join t_product on fk_productId=pk_productId where fk_userId=#{userId}")
    List<ShopCartBean> findByUser(int userId);
}
